<header class="am-topbar am-topbar-inverse">
  <h1 class="am-topbar-brand">
    <a title="<?=WEB_NAME?>" href="<?=CONTEXT_PATH?>/">
		<img src="<?=CONTEXT_PATH?>/logo.png"/>
	</a>
  </h1>

  <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-primary am-show-sm-only" data-am-collapse="{target: '#doc-topbar-collapse'}"><span class="am-sr-only">导航切换</span> <span class="am-icon-bars"></span></button>
		
  <div class="am-collapse am-topbar-collapse" id="doc-topbar-collapse">
	<?php if(!isset($_SESSION['user'])){?>
	<div class="am-topbar-right">
	  <button class="am-btn am-btn-secondary am-topbar-btn am-btn-sm"
		data-am-modal="{target: '#app-modal-reg', closeViaDimmer: 0}"><i class="am-icon-user-plus"></i>&nbsp;&nbsp;注册</button>
	  <button class="am-btn am-btn-warning am-topbar-btn am-btn-sm"
		data-am-modal="{target: '#app-modal-login', closeViaDimmer: 0}"><i class="am-icon-sign-in"></i>&nbsp;&nbsp;登录
	  </button>
	</div>
	<?php }?>
	<div class="am-topbar-right">
		<ul class="am-nav am-nav-pills am-topbar-nav">
		  <li <?=$nav=='home'?'class="am-active"':'';?> ><a href="<?=CONTEXT_PATH?>/"><i class="am-icon-home"></i>&nbsp;博客</a></li>
		  <li><a target="_blank" href="http://wpa.qq.com/msgrd?V=3&uin=252576269&Site=sdfsdf&Menu=yes"><i class="am-icon-info-circle"></i>&nbsp;联系本站</a></li>
		  <?php if(isset($_SESSION['user'])&&$_SESSION['user']->is_admin){?>
		  <li><a href="<?=CONTEXT_PATH?>/admin/user/login"><i class="am-icon-gear"></i>&nbsp;管理</a></li>
		  <?php }?>
		  <?php if(isset($_SESSION['user'])){?>
		   <li><a href="<?=CONTEXT_PATH?>/admin/user/logout"><i class="am-icon-sign-out"></i>&nbsp;退出</a></li>
		  <?php }?>
		</ul>
	</div>
	<form id="navForm" class="am-topbar-form am-topbar-right am-form-inline" action="<?=CONTEXT_PATH?>/blog/index" role="search">
	   <div class="am-form-group am-form-icon">
			<i class="am-icon-search"></i>
			<input name="key" type="text" class="am-form-field am-input-sm am-round" placeholder="输入关键字搜索" value="<?=$title?>" onfocus="if($(this).width()<200) $(this).width(200);" onblur="if($(this).width()<210) $(this).css('width','auto');">
		  </div>
    </form>
  </div>
</header>
<?php global $APP_CONFIG;?>
<script>_ctx = "<?=CONTEXT_PATH?>";_version="<?=VERSION?>";_isLogin=<?=isset($_SESSION['user'])?1:0?>;_task_open=<?=$APP_CONFIG['TASK_OPEN']?'true':'false'?>;</script>